/* -*- idl -*- */

//=============================================================================
/**
 *  @file    RTCosScheduling.idl
 *
 *  $Id$
 *
 *  @author Matt Murphy <murphym@cs.uri.edu>
 */
//=============================================================================

/**
 * This directory contains the idl for the RTCORBA 1.0 Scheduling Service.
 * To generate the stubs and skeletons, run
 * tao_idl -I $TAO_ROOT/ RTCosScheduling.idl
 *
 */


#ifndef _RT_COS_SCHEDULING_
#define _RT_COS_SCHEDULING_

#include <orb.idl>
#include "tao/PortableServer/PortableServer_include.pidl"

/**
 * @module RTCosScheduling
 *
 * @brief This module contains the interfaces for the RTCORBA 1.0
 * Scheduling Service.
 */
module RTCosScheduling {

  /**
   * This exception is thrown by schedule activity when an activity name
   * is passed that is associated with a priority in the config file.
   * It is thrown by schedule_object when an object name is passed in
   * that was not assiciated with a resource priority ceiling in the
   * config file.
   */
  exception UnknownName {};

  /**
   * @interface ClientScheduler
   *
   * @brief This interface is used by clients who wish to
   * schedule activities using the RT CORBA 1.0 Scheduling Service.
   */
  local interface ClientScheduler {

    /**
     * schedule_activity associates an activity name with a known priority
     * for that activity.  It then sets RT Current to that priority.
     * If the name passed does not have a priority associated then
     * schedule_activity throws an UnknownName exception.
     *
     * @param activity_name is the name of the activity that the client
     * would like to run.  The activity_name is associated with a
     * priority by schedule_activity and RT Current is set to that
     * priority.
     */
    void schedule_activity(in string activity_name )
      raises (UnknownName);
    };

  /**
   * @interface ServerScheduler
   *
   * @brief This interface is used by nodes that hold a local object
   * reference.
   */
  local interface ServerScheduler {

    /**
     * create_POA is called by servers that would like to use the
     * RT CORBA 2.0 Scheduling Service.
     *
     * @param parent The poa to base the RT POA upon
     * @param adapter_name the adapter name for the poa
     * @param a_POAManager the poa_manager
     * @param policies the list of non real time policies to be set
     *
     */
    PortableServer::POA create_POA (
      in PortableServer::POA parent,
      in string adapter_name,
      in PortableServer::POAManager a_POAManager,
      in CORBA::PolicyList policies)
        raises (PortableServer::POA::AdapterAlreadyExists,
                PortableServer::POA::InvalidPolicy);

    /**
     * schedule_object is called on servers to associate a
     * CORBA object reference with a name.  This allows the
     * scheduling service to map a server object name to a resource
     * ceiling.  An UnknownName exception is found if the object name
     * is not found in the config file.
     */
    void schedule_object(in Object obj, in string name)
      raises (UnknownName);

  };
};


#endif  // _RT_COS_SCHEDULING_IDL_
